package topevery.syn.data.model;


import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import topevery.syn.data.model.codec.ModelTypeEnumCodec;

import java.time.LocalDateTime;

/**
 * @author Admin
 */
@Data
public class StateData implements IGlbModel {

    @JSONField(name = "a")
    public Long gid;

    @JSONField(name = "b", serializeUsing = ModelTypeEnumCodec.class, deserializeUsing = ModelTypeEnumCodec.class)
    public ModelTypeEnum modelType = ModelTypeEnum.State;

    @Override
    public Long getGid() {
        return gid;
    }

    @Override
    public void setGid(Long gid) {
        this.gid = gid;
    }

    @Override
    public ModelTypeEnum getModelType() {
        return modelType;
    }

    @Override
    public void setModelType(ModelTypeEnum modelType) {
        this.modelType = modelType;
    }

    @JSONField(name = "d")
    public Long fid;

    @JSONField(name = "f")
    public Short dataSource;

    @JSONField(name = "g")
    public String terminalKey;

    @JSONField(name = "h")
    public String terminalIp;

    @JSONField(name = "i")
    public Integer terminalPort;

    @JSONField(name = "e")
    public LocalDateTime dbCreateDate;

    @JSONField(name = "n")
    public Boolean accState;

    @JSONField(name = "m")
    public Boolean chargeState;
    /// <summary> chargestate
    /// 客户端信息
    /// </summary>
    @JSONField(name = "r")
    public Short clientInfo;

    @JSONField(name = "o")
    public Boolean defendState;
    /// <summary>
    /// GPS状态
    /// </summary> gps_state
    @JSONField(name = "k")
    public Boolean gpsState;
    /// <summary>
    /// GSM信号强度
    /// </summary>
    @JSONField(name = "q")
    public Short gsmSignalIntensity;
    /// <summary>
    /// 语言
    /// 1：cn
    /// 2：en
    /// </summary>
    @JSONField(name = "t")
    public Short language;
    /// <summary>
    /// 油电状态
    /// </summary>

    @JSONField(name = "j")
    public Boolean oliTelegramState;
    /// <summary>
    /// 电压等级
    /// </summary>
    @JSONField(name = "p")
    public Short voltageLevel;

    /// <summary>
    /// 告警扩展
    ///
    ///0x00：正常
    ///0x01：SOS 求救
    ///0x02：断电报警
    ///0x03: 震动报警
    ///0x04: 进围栏报警
    ///0x05: 出围栏报警
    ///0x06 超速报警
    ///0x09 位移报警
    ///0x0A 进GPS 盲区报警
    ///0x0B 出GPS 盲区报警
    ///0x0C 开机报警
    ///0x0D GPS 第一次定位报警
    /// </summary> warning_ext_info
    @JSONField(name = "s")
    public Short warningExtInfo;

    /// <summary>
    ///0--000：正常
    ///1--100：SOS 求救
    ///2--101: 疲劳驾驶
    ///3--110：超速报警
    ///4--011：低电报警
    ///5--010：断电报警
    ///6--001：震动报警
    /// </summary> warning_state

    @JSONField(name = "l")
    public Short warningState;
    public String data16hex;

    @JSONField(name = "u")
    public Short warningExtInfoChild0;
    public String serviceIp;
    public String servicePort;

    @JSONField(name = "v")
    public Integer stepCountCurr;

    @JSONField(name = "w")
    public Integer stepCountPre;

    @JSONField(name = "x")
    public Integer stepCountDiffer;


    @JSONField(name = "y")
    public String nearbyImei;

    @JSONField(name = "a1")
    public double speedUpX;

    @JSONField(name = "a2")
    public double speedUpY;

    @JSONField(name = "a3")
    public double speedUpZ;

    /// <summary>
    /// 心率
    /// </summary>

    @JSONField(name = "a4")
    public int heartRate;

    /// <summary>
    /// 体温
    /// </summary>
    @JSONField(name = "a5")
    public double temperature;

    //文件id
    @JSONField(name = "a6")
    public String fileId;

    @Override
    public String getGlbModelKey() {
        return terminalKey;
    }
}
